﻿using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AgentSystem.AgentCreator.Sbpel.Activities
{
    /// <summary>
    /// Base Abstract Class for all Activities.
    /// </summary>
    public abstract class AbstractActivity
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractActivity"/> class.
        /// </summary>
        public AbstractActivity(AbstractActivity parent)
        {
            ChildActivities = new List<AbstractActivity>();
            ParentActivity = parent;
        }

        /// <summary>
        /// The child activities.
        /// </summary>
        public IList<AbstractActivity> ChildActivities { get; protected set; }

        /// <summary>
        /// The parent activity.
        /// </summary>
        public AbstractActivity ParentActivity { get; protected set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is root.
        /// </summary>
        public bool IsRoot { get; protected set; }

        /// <summary>
        /// The Activity name.
        /// </summary>
        public string Name { get; protected set; }

        /// <summary>
        /// To the code string.
        /// </summary>
        /// <returns> String representing C# code </returns>
        public abstract CodeObject[] GetCodeDom();
    }
}
